home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / PerfectPaint / rexx / circle / LensFlare.rx < prev    next >
Encoding:
Text File  |  2002-03-13  |  15.3 KB  |  701 lines

  1. /*
  2.     Draw and Anim Lens Flare
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.   parse ARG Port x1 y1 r2 b
  9.     ADDRESS value Port
  10.  
  11.     pp_CountFrames
  12.     Total_Frame=result
  13.     if Total_Frame=0 then Total_Frame=1
  14.     Start_Frame=1
  15.     End_Frame=Total_Frame
  16.  
  17.     pp_GetDepth
  18.     Dp=result
  19.     if Dp<24 then DO
  20.         pp_Warn 'This*script*is*only|for*24bits*Picture.'    
  21.         pp_PermitRefresh
  22.         Exit
  23.     END
  24.  
  25.     Anim=0;Path=0;Type=0
  26.     Light=0
  27.     Start_B1=100;End_B1=100
  28.     Start_B2=48;End_B2=48
  29.     Start_S=r2;End_S=r2
  30.     Arti=1
  31.     Glob=0
  32.  
  33.     Pi=3.1415926/180
  34.     totalR=r2*2
  35.     RayShade=100-Start_B1
  36.     NbStar=8
  37.  
  38.     ADDRESS COMMAND
  39.     file="T:pp_lens"
  40.     IF OPEN('b',file,'R') then DO
  41.         Anim=READLN('b')
  42.         Path=READLN('b')
  43.         Type=READLN('b')
  44.         Light=READLN('b')
  45.         Start_B1=READLN('b')
  46.         End_B1=READLN('b')
  47.         Start_B2=READLN('b')
  48.         End_B2=READLN('b')
  49.         Arti=READLN('b')
  50.         Glob=READLN('b')
  51.         CALL CLOSE('b')
  52.     END
  53.  
  54.     ADDRESS value Port
  55.     R=-1
  56.  
  57. DO UNTIL R>-1
  58.  
  59.     pp_DialogInit 250 270 "*LENS*FLARE*" 10
  60.     pp_Cycle 0 70 5 100 16 "Animation" 1 "No|Yes" Anim
  61.     pp_Cycle 1 70 35 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
  62.     pp_Cycle 2 70 53 100 16 "Type" 1 "In|Out" Type
  63.     pp_Button 3 20 71 200 16 '*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
  64.     
  65.     pp_Cycle 4 70 100 100 16 "Light" 1 "Rays|Glow|Star" Light
  66.     pp_Button 5 20 118 200 16 '*Brightness*(*'||Start_B1||'*->*'||End_B1||'*)*'
  67.     pp_Button 6 20 136 200 16 '*Size*(*'||Start_S||'*->*'||End_S||'*)*'
  68.  
  69.     pp_Cycle 7 70 165 100 16 "Artifacts" 1 "None|Standard|Spot|Spot2" Arti
  70.  
  71.     pp_Cycle 8 70 194 100 16 "Globals" 1 "Red|Blue|Yellow|White" Glob
  72.     pp_Button 9 20 212 200 16 '*Brightness*(*'||Start_B2||'*->*'||End_B2||'*)*'
  73.     
  74.     pp_Dialog
  75.     R=result
  76.  
  77.     pp_GetDialog 0
  78.     Anim=result
  79.  
  80.     pp_GetDialog 1
  81.     Path=result
  82.  
  83.     pp_GetDialog 2
  84.     Type=result
  85.  
  86.     pp_GetDialog 4
  87.     Light=result
  88.  
  89.     pp_GetDialog 7
  90.     Arti=result
  91.  
  92.     pp_GetDialog 8
  93.     Glob=result
  94.  
  95.     if R=-3 then DO
  96.         pp_DialogInit 150 80 "*FRAME*" 2
  97.             pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
  98.             pp_Integer 1 60 25 50 16 "End" 1 End_Frame
  99.         pp_Dialog
  100.         rc=result
  101.         IF rc=1 then DO
  102.             pp_GetDialog 0
  103.             Start_Frame=result
  104.  
  105.             pp_GetDialog 1
  106.             End_Frame=result
  107.  
  108.             IF End_Frame>Total_Frame THEN DO
  109.                 End_Frame=Total_Frame
  110.             END
  111.  
  112.             IF Start_Frame>End_Frame THEN DO
  113.                 Start_Frame=1
  114.             END
  115.  
  116.         END            
  117.     END
  118.  
  119.     if R=-5 then DO
  120.         if Anim=1 then DO
  121.             pp_DialogInit 150 75 "*LIGHT.BRIGHTNESS*" 2
  122.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B1
  123.             pp_Integer 1 60 25 50 16 "End" 1 End_B1
  124.             pp_Dialog
  125.             rc=result
  126.             IF rc=1 then DO
  127.                 pp_GetDialog 0
  128.                 Start_B1=result
  129.                 pp_GetDialog 1
  130.                 End_B1=result        
  131.             END
  132.         END
  133.         ELSE DO
  134.             pp_DialogInit 150 55 "*LIGHT.BRIGHTNESS*" 1
  135.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B1
  136.             pp_Dialog
  137.             rc=result
  138.             IF rc=1 then DO
  139.                 pp_GetDialog 0
  140.                 Start_B1=result
  141.                 End_B1=result        
  142.             END
  143.         END            
  144.     END
  145.  
  146.     if R=-6 then DO
  147.         if Anim=1 then DO
  148.             pp_DialogInit 150 75 "*LIGHT.SIZE*" 2
  149.             pp_Integer 0 60 5 50 16 "Start" 1 Start_S
  150.             pp_Integer 1 60 25 50 16 "End" 1 End_S
  151.             pp_Dialog
  152.             rc=result
  153.             IF rc=1 then DO
  154.                 pp_GetDialog 0
  155.                 Start_S=result
  156.                 pp_GetDialog 1
  157.                 End_S=result        
  158.             END
  159.         END
  160.         ELSE DO
  161.             pp_DialogInit 150 55 "*LIGHT.SIZE*" 1
  162.             pp_Integer 0 60 5 50 16 "Size" 1 Start_S
  163.             pp_Dialog
  164.             rc=result
  165.             IF rc=1 then DO
  166.                 pp_GetDialog 0
  167.                 Start_S=result
  168.                 End_S=result        
  169.             END
  170.         END            
  171.     END
  172.  
  173.     if R=-9 then DO
  174.         if Anim=1 then DO
  175.             pp_DialogInit 150 75 "*GLOBAL.BRIGHTNESS*" 2
  176.             pp_Integer 0 60 5 50 16 "Start" 1 Start_B2
  177.             pp_Integer 1 60 25 50 16 "End" 1 End_B2
  178.             pp_Dialog
  179.             rc=result
  180.             IF rc=1 then DO
  181.                 pp_GetDialog 0
  182.                 Start_B2=result
  183.                 pp_GetDialog 1
  184.                 End_B2=result        
  185.             END
  186.         END
  187.         ELSE DO
  188.             pp_DialogInit 150 55 "*GLOBAL.BRIGHTNESS*" 1
  189.             pp_Integer 0 75 5 50 16 "Brightness" 1 Start_B2
  190.             pp_Dialog
  191.             rc=result
  192.             IF rc=1 then DO
  193.                 pp_GetDialog 0
  194.                 Start_B2=result
  195.                 End_B2=result        
  196.             END
  197.         END            
  198.     END
  199. END
  200.  
  201.     if R=0 then DO
  202.         EXIT
  203.     END    
  204.  
  205.     if End_Frame<2 then do
  206.         if Anim=1 then DO
  207.             pp_Warn 'Make*an*Anim*first.'
  208.             EXIT
  209.         end
  210.     end
  211.  
  212.     ADDRESS COMMAND
  213.  
  214.     file='t:pp_lens'
  215.  
  216.     IF EXISTS(file) THEN DO
  217.         'delete >nil: t:pp_lens'
  218.     END
  219.  
  220.     IF OPEN('c',file,'W') then DO
  221.         CALL WRITELN('c',Anim)
  222.         CALL WRITELN('c',Path)
  223.         CALL WRITELN('c',Type)
  224.         CALL WRITELN('c',Light)
  225.         CALL WRITELN('c',Start_B1)
  226.         CALL WRITELN('c',End_B1)
  227.         CALL WRITELN('c',Start_B2)
  228.         CALL WRITELN('c',End_B2)
  229.         CALL WRITELN('c',Arti)
  230.         CALL WRITELN('c',Glob)
  231.         CALL CLOSE('c')
  232.     END
  233.  
  234.     ADDRESS value Port
  235.  
  236.     pp_AliasOn
  237.     pp_PenType 0
  238.     pp_ComposeReqOff
  239.  
  240.     pp_ClosestColor 0 0 0
  241.     color=result
  242.     pp_SetBpen color
  243.     pp_ClosestColor 255 255 255
  244.     color=result
  245.     pp_SetApen color
  246.  
  247.     pp_Compose 0 100 0    
  248.  
  249.     IF Anim=0 THEN DO
  250.         pp_SpareOnOff
  251.         pp_Cls
  252.  
  253.         r=Start_S
  254.         totalR=r*2
  255.         RayShade=100-Start_B1
  256.  
  257.         if Light=0 then CALL DrawRays()
  258.         if Light=1 then CALL DrawGlow()
  259.         if Light=2 then CALL DrawStar()
  260.  
  261.         pp_SpareOnOff
  262.         pp_UpdateUndo
  263.         pp_EffectOn
  264.  
  265.         pp_Compose 1 100 0    
  266.         pp_Gradient 10 2 x1 y1
  267.  
  268.         pp_ClearRange 10
  269.         pp_setRange 10 0 0 0 0
  270.         pp_setRange 10 4 0 0 0
  271.  
  272.         if Glob=0 then pp_setRange 10 16 Start_B2 0 0
  273.         if Glob=1 then pp_setRange 10 16 0 0 Start_B2
  274.         if Glob=2 then pp_setRange 10 16 Start_B2 Start_B2 0
  275.         if Glob=3 then pp_setRange 10 16 Start_B2 Start_B2 Start_B2
  276.  
  277.         pp_setRange 10 19 Start_B2 Start_B2 Start_B2
  278.         pp_CircleF x1 y1 TotalR
  279.  
  280.         pp_Spare
  281.         pp_Compose 1 100 0
  282.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  283.  
  284.         if Arti>0 then CALL DrawArtefacts()
  285.         
  286.     END
  287.     ELSE DO
  288.  
  289.         pp_GetWidth
  290.         W=result
  291.  
  292.         pp_GetHeight
  293.         H=result
  294.  
  295.         HX=r2
  296.         HY=r2
  297.  
  298.         Start_X=x1
  299.         End_X=x1
  300.         Start_Y=y1
  301.         End_Y=y1
  302.  
  303.         IF Path=1 then DO
  304.             IF Type=0 then DO
  305.                 Start_X=HX*-1
  306.             END
  307.             ELSE DO
  308.                 End_X=HX*-1
  309.             END
  310.         END
  311.  
  312.         IF Path=2 then DO
  313.             IF Type=0 then DO
  314.                 Start_X=W+HX
  315.             END
  316.             ELSE DO
  317.                 End_X=W+HX
  318.             END
  319.         END
  320.  
  321.         IF Path=3 then DO
  322.             IF Type=0 then DO
  323.                 Start_Y=HY*-1
  324.             END
  325.             ELSE DO
  326.                 End_Y=HY*-1
  327.             END
  328.         END
  329.  
  330.         IF Path=4 then DO
  331.             IF Type=0 then DO
  332.                 Start_Y=H+HY
  333.             END
  334.             ELSE DO
  335.                 End_Y=H+HY
  336.             END
  337.         END
  338.  
  339.         step=(End_Frame-Start_Frame)
  340.  
  341.         Step_B1=(End_B1-Start_B1)/Step
  342.         Step_B2=(End_B2-Start_B2)/Step
  343.         Step_S=(End_S-Start_S)/Step
  344.         Step_X=(End_X-Start_X)/Step
  345.         Step_Y=(End_Y-Start_Y)/Step
  346.  
  347.  
  348.  
  349.         DO i=Start_Frame to End_Frame
  350.             pp_GotoFrame i
  351.             r=trunc(Start_S+Step_S*(i-Start_Frame)+0.5,0)
  352.             RayShade=100-trunc(Start_B1+Step_B1*(i-Start_Frame)+0.5,0)
  353.             B2=trunc(Start_B2+Step_B2*(i-Start_Frame)+0.5,0)            
  354.             x1=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
  355.             y1=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
  356.  
  357.             pp_SpareOnOff
  358.             pp_Cls
  359.  
  360.             totalR=r*2
  361.  
  362.             if Light=0 then CALL DrawRays()
  363.             if Light=1 then CALL DrawGlow()
  364.             if Light=2 then CALL DrawStar()
  365.  
  366.             pp_SpareOnOff
  367.             pp_EffectOn
  368.  
  369.             pp_Compose 1 100 0    
  370.             pp_Gradient 10 2 x1 y1
  371.  
  372.             pp_ClearRange 10
  373.             pp_setRange 10 0 0 0 0
  374.             pp_setRange 10 4 0 0 0
  375.  
  376.             if Glob=0 then pp_setRange 10 16 B2 0 0
  377.             if Glob=1 then pp_setRange 10 16 0 0 B2
  378.             if Glob=2 then pp_setRange 10 16 B2 B2 0
  379.             if Glob=3 then pp_setRange 10 16 B2 B2 B2
  380.  
  381.             pp_setRange 10 19 B2 B2 B2
  382.             pp_CircleF x1 y1 TotalR
  383.  
  384.             pp_Spare
  385.             pp_Compose 1 100 0
  386.             pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  387.  
  388.             if Arti>0 then CALL DrawArtefacts()
  389.         END
  390.         pp_GotoFrame Start_Frame
  391.     END
  392.  
  393.     pp_Compose 0 100 0
  394.     pp_ComposeReqOn
  395.  
  396.  
  397. EXIT
  398.     
  399. /*********************************************************/
  400. /*                       Draw Star                       */
  401. /*********************************************************/
  402.  
  403. DrawStar: PROCEDURE EXPOSE x1 y1 r Pi totalR NbStar RayShade
  404.  
  405.     pp_Compose 0 100 0
  406.     pp_EffectOff
  407.     r2=4
  408.     a=360/NbStar
  409.     a2=a/2
  410.  
  411.   DO i=0 To 359 by a
  412.         r3=r
  413.  
  414.       x = Sin(i*Pi)*r3+x1
  415.     y = Cos(i*Pi)*r3+y1
  416.  
  417.         ii=i+a2
  418.       x2 = Sin(ii*Pi)*r2+x1
  419.     y2 = Cos(ii*Pi)*r2+y1
  420.  
  421.         ii=i-a2
  422.       x3 = Sin(ii*Pi)*r2+x1
  423.     y3 = Cos(ii*Pi)*r2+y1
  424.  
  425.         pp_StartPoly
  426.         pp_AddPoly trunc(x3+0.5) trunc(y3+0.5)
  427.         pp_AddPoly trunc(x2+0.5) trunc(y2+0.5)
  428.         pp_AddPoly trunc(x+0.5) trunc(y+0.5)
  429.         pp_EndPolyF
  430.  
  431.     END
  432.  
  433.     pp_EffectOn
  434.     rr=trunc(r/6)
  435.     if rr<3 then rr=3
  436.     pp_Airbrush 100 rr
  437.  
  438.  
  439.     pp_CircleF x1 y1 rr
  440.  
  441.     pp_EffectOn
  442.     pp_ConvInit 1 25 0
  443.     pp_Conv 0 1 1 1 1 1
  444.     pp_Conv 1 1 1 1 1 1
  445.     pp_Conv 2 1 1 1 1 1
  446.     pp_Conv 3 1 1 1 1 1
  447.     pp_Conv 4 1 1 1 1 1    
  448. /*    
  449.     pp_ConvInit 1 159 0    
  450.     pp_Conv 0 2 4 5 4 2
  451.     pp_Conv 1 4 9 12 9 4
  452.     pp_Conv 2 5 12 15 12 5
  453.     pp_Conv 3 4 9 12 9 4
  454.     pp_Conv 4 2 4 5 4 2
  455. */
  456.  
  457.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  458.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  459.  
  460.  
  461.     if RayShade >0 then DO
  462.     pp_Shade RayShade
  463.     pp_BoxF x1-r-2 y1-r-2 x1+r+2 y1+r+2
  464.     END
  465.  
  466. RETURN
  467.  
  468. /*********************************************************/
  469. /*                       Draw Glow                       */
  470. /*********************************************************/
  471. DrawGlow: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  472.     pp_EffectOn
  473.     AB=r*0.5
  474.     if AB>20 then AB=20
  475.     if AB<2 then AB=2
  476.     
  477.     pp_AirBrush 100 trunc(AB)
  478.     pp_CircleF x1 y1 r/2.5
  479.  
  480.     if RayShade >0 then DO
  481.         pp_Shade RayShade
  482.         pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  483.     END
  484. RETURN
  485.  
  486. /*********************************************************/
  487. /*                       Draw Ray                        */
  488. /*********************************************************/
  489.  
  490. DrawRays: PROCEDURE EXPOSE x1 y1 r Pi totalR RayShade
  491. RN=abs(x1*y1)+totalR*RayShade
  492. pp_Compose 0 100 0
  493. pp_EffectOff
  494. aa=random(100,200,RN)
  495. DO j=1 to 5
  496.     aa=aa/2
  497.     a=360/aa
  498.     a2=a/2    
  499.   DO i=aa To 359+aa by a
  500.         r3=totalR
  501.     x = Sin(i*Pi)*r3+x1
  502.     y = Cos(i*Pi)*r3+y1
  503.         pp_line x1 y1 x y
  504.     END
  505.     pp_EffectOn
  506.     pp_ConvInit 0 9 0
  507.     pp_Conv 0 1 1 1 1 1
  508.     pp_Conv 1 1 1 1 1 1
  509.     pp_Conv 2 1 1 1 1 1
  510.     pp_Conv 3 1 1 1 1 1
  511.     pp_Conv 4 1 1 1 1 1    
  512.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  513.     pp_EffectOff
  514. END    
  515.  
  516.     pp_EffectOn
  517.     pp_Gradient 10 2 x1 y1
  518.     pp_ClearRange 10
  519.     pp_setRange 10 0 0 0 0
  520.     pp_setRange 10 10 0 0 0
  521.     pp_setRange 10 16 255 255 255
  522.     pp_setRange 10 19 255 255 255
  523.     pp_Compose 4 100 0
  524.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  525.  
  526.     if RayShade >0 then DO
  527.     pp_Shade RayShade
  528.     pp_BoxF x1-totalR-2 y1-totalR-2 x1+totalR+2 y1+totalR+2
  529.     END
  530.  
  531.     pp_EffectOff
  532.  
  533. RETURN
  534.  
  535.  
  536. /*********************************************************/
  537. /*                       Draw Rings                   */
  538. /*********************************************************/
  539.  
  540. DrawRings: PROCEDURE EXPOSE x1 y1 r
  541.         pp_EffectOn
  542.         pp_Compose 1 100 0    
  543.         pp_Gradient 10 2 x1 y1
  544.         pp_ClearRange 10
  545.         pp_setRange 10 0 0 0 0
  546.         pp_setRange 10 5 0 0 0
  547.         pp_setRange 10 6 48 0 0
  548.         pp_setRange 10 7 0 0 0
  549.         pp_setRange 10 13 48 0 0
  550.         pp_setRange 10 19 0 0 0
  551.  
  552.         pp_CircleF x1 y1 r
  553.  
  554. RETURN
  555.  
  556.  
  557. /*********************************************************/
  558. /*                       Draw artifact                   */
  559. /*********************************************************/
  560.  
  561. DrawArtefacts: PROCEDURE EXPOSE x1 y1 r totalR Arti
  562.  
  563.     pp_GetWidth
  564.     cx=trunc(result/2)
  565.     pp_GetHeight
  566.     cy=trunc(result/2)
  567.  
  568. if Arti=1 then do
  569. Nb_Spot=15
  570. t.1=1;s.1=25;d.1=123;c.1=15;r.1=255;g.1=255;b.1=255
  571. t.2=3;s.2=60;d.2=100;c.2=15;r.2=255;g.2=20;b.2=0
  572. t.3=1;s.3=13;d.3=58;c.3=10;r.3=160;g.3=160;b.3=255
  573. t.4=2;s.4=33;d.4=54;c.4=5;r.4=160;g.4=160;b.4=255
  574. t.5=2;s.5=16;d.5=50;c.5=10;r.5=160;g.5=160;b.5=255
  575. t.6=2;s.6=10;d.6=30;c.6=20;r.6=255;g.6=160;b.6=25
  576. t.7=4;s.7=4;d.7=18;c.7=50;r.7=255;g.7=255;b.7=255
  577. t.8=4;s.8=6;d.8=-4;c.8=50;r.8=255;g.8=255;b.8=255
  578. t.9=1;s.9=23;d.9=-15;c.9=12;r.9=255;g.9=160;b.9=25
  579. t.10=1;s.10=44;d.10=-18;c.10=12;r.10=255;g.10=160;b.10=25
  580. t.11=1;s.11=10;d.11=-21;c.11=12;r.11=255;g.11=160;b.11=25
  581. t.12=1;s.12=15;d.12=-36;c.12=15;r.12=145;g.12=255;b.12=145
  582. t.13=2;s.13=8;d.13=-40;c.13=20;r.13=100;g.13=120;b.13=255
  583. t.14=3;s.14=63;d.14=-67;c.14=12;r.14=145;g.14=255;b.14=145
  584. t.15=5;s.15=133;d.15=-100;c.15=10;r.15=255;g.15=255;b.15=255
  585. end
  586.  
  587. if Arti=2 then do
  588. Nb_Spot=25
  589. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  590. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=50;b.2=230
  591. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  592. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  593. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=80;b.5=250
  594. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  595. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=55;b.7=245
  596. t.8=1;s.8=12;d.8=23;c.8=21;r.8=60;g.8=50;b.8=255
  597. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  598. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=55;b.10=255
  599. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  600. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=50;b.12=255
  601. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=50;g.13=50;b.13=235
  602. t.14=1;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  603. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  604. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=50;b.16=245
  605. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=50;b.17=230
  606. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  607. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=55;b.19=225
  608. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  609. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=55;b.21=225
  610. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=60;b.22=255
  611. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  612. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=55;g.24=55;b.24=245
  613. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=50;b.25=255
  614. end
  615.  
  616. if Arti=3 then do
  617. Nb_Spot=25
  618. t.1=1;s.1=21;d.1=86;c.1=16;r.1=210;g.1=250;b.1=255
  619. t.2=4;s.2=18;d.2=77;c.2=20;r.2=60;g.2=150;b.2=230
  620. t.3=1;s.3=16;d.3=69;c.3=25;r.3=220;g.3=220;b.3=235
  621. t.4=4;s.4=18;d.4=61;c.4=12;r.4=220;g.4=245;b.4=245
  622. t.5=1;s.5=17;d.5=51;c.5=18;r.5=50;g.5=180;b.5=250
  623. t.6=1;s.6=18;d.6=42;c.6=26;r.6=225;g.6=210;b.6=250
  624. t.7=4;s.7=16;d.7=33;c.7=18;r.7=55;g.7=155;b.7=245
  625. t.8=1;s.8=12;d.8=23;c.8=21;r.8=50;g.8=250;b.8=255
  626. t.9=1;s.9=9;d.9=15;c.9=30;r.9=210;g.9=227;b.9=250
  627. t.10=4;s.10=6;d.10=7;c.10=18;r.10=55;g.10=155;b.10=255
  628. t.11=4;s.11=7;d.11=1;c.11=23;r.11=250;g.11=225;b.11=255
  629. t.12=1;s.12=5;d.12=-9;c.12=14;r.12=60;g.12=150;b.12=255
  630. t.13=1;s.13=6;d.13=-17;c.13=21;r.13=150;g.13=150;b.13=235
  631. t.14=2;s.14=9;d.14=-27;c.14=24;r.14=210;g.14=230;b.14=250
  632. t.15=4;s.15=11;d.15=-32;c.15=23;r.15=225;g.15=225;b.15=255
  633. t.16=1;s.16=16;d.16=-41;c.16=13;r.16=60;g.16=150;b.16=245
  634. t.17=4;s.17=17;d.17=-53;c.17=21;r.17=80;g.17=150;b.17=230
  635. t.18=4;s.18=15;d.18=-60;c.18=25;r.18=215;g.18=210;b.18=235
  636. t.19=1;s.19=19;d.19=-71;c.19=15;r.19=60;g.19=155;b.19=225
  637. t.20=1;s.20=19;d.20=-84;c.20=19;r.20=240;g.20=240;b.20=245
  638. t.21=4;s.21=19;d.21=-92;c.21=22;r.21=90;g.21=155;b.21=225
  639. t.22=1;s.22=27;d.22=-103;c.22=20;r.22=60;g.22=160;b.22=255
  640. t.23=4;s.23=30;d.23=-115;c.23=16;r.23=210;g.23=225;b.23=255
  641. t.24=1;s.24=26;d.24=-123;c.24=21;r.24=255;g.24=255;b.24=255
  642. t.25=1;s.25=34;d.25=-135;c.25=23;r.25=50;g.25=150;b.25=255
  643. end
  644.  
  645.     pp_Compose 1 100 0    
  646.  
  647.     DO i=1 TO Nb_Spot
  648.     spot_size = trunc((r*s.i)/100)
  649.     spot_x  = ((x1 - cx) * d.i)/100 + cx
  650.     spot_y = ((y1 - cy) * d.i)/100 + cy
  651.  
  652.         spot_r = ((r.i*c.i)/100)
  653.         spot_g = ((g.i*c.i)/100)    
  654.         spot_b = ((b.i*c.i)/100)
  655.  
  656.         pp_Gradient 10 2 spot_x spot_y
  657.  
  658.         pp_ClearRange 10
  659.         
  660.         SELECT
  661.             WHEN t.i=1 then DO
  662.                 pp_setRange 10 0 0 0 0
  663.         pp_setRange 10 5 0 0 0
  664.         pp_setRange 10 7 spot_r spot_g spot_b
  665.                 pp_setRange 10 15 0 0 0
  666.                 pp_setRange 10 19 0 0 0
  667.       END
  668.             WHEN t.i=2 then DO
  669.         pp_setRange 10 5 0 0 0
  670.         pp_setRange 10 7 spot_r spot_g spot_b
  671.         pp_setRange 10 19 spot_r spot_g spot_b
  672.             END
  673.             WHEN t.i=3 then DO
  674.         pp_setRange 10 5 0 0 0
  675.         pp_setRange 10 6 spot_r spot_g spot_b
  676.         pp_setRange 10 8 0 0 0
  677.                 pp_setRange 10 19 0 0 0
  678.             END
  679.             WHEN t.i=4 then DO
  680.         pp_setRange 10 5 0 0 0
  681.         pp_setRange 10 16 spot_r spot_g spot_b
  682.         pp_setRange 10 19 spot_r spot_g spot_b
  683.             END
  684.             WHEN t.i=5 then DO
  685.                 spot_r = ((255*c.i)/100)
  686.         pp_setRange 10 5 0 0 0
  687.         pp_setRange 10 6 spot_r 0 0
  688.         pp_setRange 10 7 0 spot_r 0
  689.         pp_setRange 10 8 0 0 spot_r
  690.         pp_setRange 10 9 0 0 0
  691.                 pp_setRange 10 19 0 0 0
  692.             END
  693.         END        
  694.  
  695.         pp_CircleF spot_x spot_y spot_size
  696.  
  697.     END
  698.  
  699. RETURN
  700.     
  701.